package com.zxy.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Zxy
 * @description:
 * @date: 2021-07-19 19:13
 */
@RestController
@RefreshScope // 远端修改配置文件及时刷新
public class DemoController {

    private final Logger log= LoggerFactory.getLogger(DemoController.class);

    @Value("${customer.username}")
    private String username;
    @GetMapping("/demo")
    public String demo(){
        log.info("demo ok!!!");
        return "demo ok !! username:"+username;
    }
}
